package com.IR.product.service;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.IR.shop.mapper.ProductcommentMapper;
import com.IR.shop.po.Productcomment;

@Service
public class AProductCommentBIZ {

	@Resource
	private ProductcommentMapper productcommentmapper;
	
	/*删除评论*/
	public void deleteProComment(int pcid) {
		productcommentmapper.deleteByPrimaryKey(pcid);
	}
	
	/*添加评论*/
	public void saveProComment(Productcomment procomment) {
		SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		String sss=sdf.format(new Date());	
		try {
			procomment.setPcdate(sdf.parse(sss));
		} catch (ParseException e) {
			e.printStackTrace();
		}
		productcommentmapper.insert(procomment);
	}
	
	
}
